package com.example.ycdyus.dailyfruit.adapter;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.example.ycdyus.dailyfruit.R;
import com.example.ycdyus.dailyfruit.bean.Top;

import java.util.List;

/**
 * Created by ycdyus on 2015/10/22.
 */
public class GuoyouHeadAdapter extends CommonAdapter<Top>{
    public GuoyouHeadAdapter(Context context, List<Top> mDatas, int itemLayoutId) {
        super(context, mDatas, itemLayoutId);
    }

    @Override
    public void convert(ViewHolders holder, Top item) {
        if(item.getPtype().equals("0"))
        {
            ((TextView)holder.getView(R.id.tv_item_guoyou_huodong)).setVisibility(View.GONE);
        }else{
            ((TextView)holder.getView(R.id.tv_item_guoyou_huodong)).setVisibility(View.VISIBLE);
        }
        ((TextView)holder.getView(R.id.tv_item_guoyou_content)).setText(item.getData().getTitle());
    }
}
